package com.gaofei.admin.controller;

import com.gaofei.admin.aspect.Log;
import com.gaofei.admin.domain.SystemLog;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @Title: AopTestController
 * @Author gaofee
 * @Package com.gaofei.admin.controller
 * @Date 2024/03/15 15:24
 * @description: 测试aop日志记录
 */
@RestController
public class AopTestController {

    //下单的方法
    @GetMapping("aopTest")
    @Log
    public String test(HttpServletRequest request){
        //1.创建订单
        //2.减库存
        //3.....
        return "下单成功";

    }
    @GetMapping("hello")
    @Log
    public String hello(HttpServletRequest request){
        return "访问用户的ip地址是:"+request.getRemoteAddr();
    }

}
